package com.design.singleton;

/**
 * 内部类模式（线程安全）
 * @author ytj
 * @date 2024/11/27 15:36
 */
public class Singleton4 {
    private static Singleton4 singleton4;

    private Singleton4(){}

    private static class Build{
        private static Singleton4 singleton4=new Singleton4();
    }

    public static Singleton4 getSingleton4(){
        return Build.singleton4;
    }
}
